/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author c0909h1169
 */
import java.util.*;
public class MethodInfo extends Thread{

    String name;
    public MethodInfo() {
    }

    public MethodInfo(String name) {
        this.name = name;
    }
   
    @Override
    public void run()
    {
        Scanner scan = new Scanner(System.in);
        System.out.println("Nhap name: ");
        name = scan.nextLine();
        System.out.println("Hello \nMy name is "+name+".\nToday, I am going to tell you in brief about some of the methods used in Thread class");
        System.out.println("The getName() method helps to retrieve the name of the current thread.");
        System.out.println("The start() method allocates the system resources necessary to run the thread and executes the run() method of its target object.");

        System.out.println("The life of a thread starts when the run() method is invoked.");
        System.out.println("The sleep() method suspends the execution of the current thread for a specified period of time.");
        System.out.println("The interrupt() method tells the thread to stop what it was doing before it has completed the task.");
        System.out.println("Thank for joining");

    }
    public void getName(String name)
    {
        this.name = name;
    }

}
